import 'package:aweb5/style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:aweb5/custom/dashed_rect.dart';
import 'dash_list.dart';
import 'package:aweb5/util/DialogUtil.dart';
import 'package:aweb5/style.dart';
import 'package:aweb5/bean/aplus/group_plan_list_entity.dart';
class ViewOfficialYunYingPlan extends StatefulWidget {
  @override
  _ViewOfficialYunYingPlanState createState() =>
      _ViewOfficialYunYingPlanState();
}

class _ViewOfficialYunYingPlanState
    extends State<ViewOfficialYunYingPlan> {

  BuildContext context;
  List<GroupPlanListDataTimeDataTaskSend> taskSend = null;
//  GroupPlanListDataMember groupPlanListDataMember = null;
  GroupPlanListDataFollow followdata=null;

  @override
  Widget build(BuildContext context) {
    this.context = context;
    return Scaffold(
      backgroundColor: Colors.white,
      body: SafeArea(
          child: Stack(
            children: <Widget>[
              Column(
                children: <Widget>[ Expanded(child: buildBody())],
              ),
              Positioned(
                bottom: ScreenUtil().setHeight(20),
                child: Container(
                  height: ScreenUtil().setHeight(40),
                  child: Row(
                    children: <Widget>[
                      SizedBox(
                        width: ScreenUtil().setWidth(32),
                      ),


                      GestureDetector(

                        child: Container(
                          width: ScreenUtil().setWidth(171),
                          height: ScreenUtil().setHeight(40),
                          alignment: Alignment.center,
                          decoration: redButtonStyle,
                          child: Text("跟随一次",style: TextStyle(color: Colors.white,fontSize: ScreenUtil().setSp(16)),),
                        ),
                        onTap: (){
                          DialogUtil.showdialog1(this.context,

                              Container(width: ScreenUtil().setWidth(323),height: ScreenUtil().setHeight(233),
                                decoration: BoxDecoration(color: Colors.white,borderRadius: BorderRadius.circular(4)),
                                child: Column(
                                  crossAxisAlignment: CrossAxisAlignment.center,
                                  children: <Widget>[
                                    SizedBox(height: ScreenUtil().setHeight(24),),
                                    Text("您将永久跟随TA的每日运营计划",style: TextStyle(color: Color(0xff000000),fontSize: ScreenUtil().setSp(16),fontWeight: FontWeight.bold),),
                                    SizedBox(height: ScreenUtil().setHeight(24),),
                                    Row(
                                      mainAxisAlignment: MainAxisAlignment.center,
                                      children: <Widget>[

                                        CircleAvatar(radius: ScreenUtil().setWidth(21.5),backgroundImage: AssetImage("assets/ab.png"),),
                                        SizedBox(width: ScreenUtil().setWidth(12),),
                                        Column(children: <Widget>[
                                          Text("呵呵",style: TextStyle(color: Color(0xff000000),fontSize: ScreenUtil().setSp(18),fontWeight: FontWeight.bold),),
                                          Container(alignment:Alignment.center,width: ScreenUtil().setWidth(56),height: ScreenUtil().setHeight(14),decoration: redButtonStyle,child: Text("官方推荐",style: TextStyle(color: Colors.white,fontSize: ScreenUtil().setSp(10)),),)

                                        ],)


                                      ],

                                    ),
                                    SizedBox(height: ScreenUtil().setHeight(33),),
                                    Row(

                                      children: <Widget>[
                                        SizedBox(width: ScreenUtil().setWidth(33),),
                                        Container(width: ScreenUtil().setWidth(119),height: ScreenUtil().setHeight(40),decoration: redButtonStyleWithBorder,alignment: Alignment.center,child: Text("取消",style: TextStyle(color: Color(0xffF94F68),fontSize: ScreenUtil().setSp(16)),),),
                                        SizedBox(width: ScreenUtil().setWidth(15),),
                                        Container(width: ScreenUtil().setWidth(119),height: ScreenUtil().setHeight(40),decoration: redButtonStyle,alignment: Alignment.center,child: Text("确定",style: TextStyle(color: Colors.white,fontSize: ScreenUtil().setSp(16)),),),





                                      ],)


                                  ],


                                ),

                              )
                              , ScreenUtil().setHeight(233));


                        },

                      )
                      ,
                      SizedBox(
                        width: ScreenUtil().setWidth(8),
                      ),
                      Container(
                        width: ScreenUtil().setWidth(171),
                        height: ScreenUtil().setHeight(40),
                        alignment: Alignment.center,
                        decoration: redButtonStyle,
                        child: Text("永远跟随",style: TextStyle(color: Colors.white,fontSize: ScreenUtil().setSp(16)),),
                      ),
                    ],
                  ),
                ),
              )
            ],
          )),
    );
  }

  Widget todayplan() {
    return Container(
        width: ScreenUtil().setWidth(414),
        color: Colors.white,
        padding: EdgeInsets.symmetric(
            horizontal: ScreenUtil().setWidth(16),
            vertical: ScreenUtil().setHeight(11)),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Column(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Text(
                  "今日计划",
                  style: TextStyle(
                      color: Color(0xff101010),
                      fontWeight: FontWeight.bold,
                      fontSize: ScreenUtil().setSp(20)),
                ),
                Text(
                  "最多显示7天内的计划  周三",
                  style: TextStyle(
                    color: Color(0xff101010),
                    fontSize: ScreenUtil().setSp(14),
                  ),
                ),
              ],
            ),
          ],
        ));
  }

  Widget buildBody() {
    return Stack(
      children: <Widget>[
        Container(
//          color: Colors.grey,
          width: ScreenUtil().setWidth(414),

          padding: EdgeInsets.only(),
          child: Column(
            children: <Widget>[
               Container(width: ScreenUtil().setWidth(414),height: ScreenUtil().setHeight(87),
               padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(19)),
               alignment: Alignment.center,
               child: Row(

                 children: <Widget>[
                   CircleAvatar(
                     radius: ScreenUtil().setWidth(22.5),
                     backgroundImage: AssetImage("assets/ab.png"),
                   ),
                   SizedBox(width: ScreenUtil().setWidth(16),),
                   Expanded(child: Column(
                     mainAxisAlignment: MainAxisAlignment.center,
                     crossAxisAlignment: CrossAxisAlignment.start,
                     children: <Widget>[
                     Row(children: <Widget>[
                       Text("官方运营的今日计划",style: TextStyle(color: Color(0xff101010),fontSize: ScreenUtil().setSp(20),fontWeight: FontWeight.bold),),
                       Expanded(child: Text("")),
                       Image.asset(
                         "assets/ab.png",
                         width: ScreenUtil().setWidth(19),
                         height: ScreenUtil().setHeight(19),
                       )

                     ],)
                     ,
                     SizedBox(height: ScreenUtil().setHeight(10),),
                       Text("2020月7月22日   周三",style: TextStyle(color: Color(0xff101010),fontSize: ScreenUtil().setSp(16),fontWeight: FontWeight.bold),),
                     
                   ],))


                 ],

               ),
               ),

              SizedBox(
                height: ScreenUtil().setHeight(19),
              ),
              Container(
//                color: Color(0xffffFFA07A),
                width: ScreenUtil().setWidth(371),
                child: DashedRect(
                  color: Color(0xff979797),
                  strokeWidth: ScreenUtil().setHeight(1),
                  gap: ScreenUtil().setWidth(3),
                ),
              ),
              SizedBox(
                height: ScreenUtil().setHeight(19),
              ),

//              DashList()
              Expanded(
                  child: Container(
                    color: Color(0xfffcfcfc),
                    width: ScreenUtil().setWidth(414),
                    child: Row(
                      children: <Widget>[
                        Expanded(child: DashList(taskSend,followdata)),
//                SizedBox(width: 5,)
                      ],
                    ),
                  ))
            ],
          ),
        ),

      ],
    );
  }
}
